function defineClass(opt) {
	var classname = opt.name;
	var superclass = opt.extend || Object;
	var constructor = opt.construct || function() {};
	var methods = opt.methods || {};
	var statics = opt.statics || {};
	var borrows;
	var provides;
	
	if(!opt.borrows) borrows = [];
	else if( opt.borrows instanceof Array ) borrows = opt.borrows;
	else borrows = [ opt.borrows ];
	
	if(!opt.provides) provides = [];
	else if( opt.provides instanceof Array ) provides = opt.provides;
	else provides = [ opt.provides ];
	
	var proto = new superclass();
	for( var p in proto ) {
		if( proto.hasOwnProperty(p) ) {
			delete proto[p];
		}
	}
	
	for( var i = 0 ; i < borrows.length; i++ ) {
		var c = opt.borrows[i];
		borrows[i] = c;
		
		for( var p in c.prototype ) {
			console.log('borrow ' + 'type ' + typeof c.prototype[p] + ' ,val : ' + c.prototype[p]);
			if(typeof c.prototype[p] != 'function') continue;
			proto[p] = c.prototype[p];
		}
	}
	
	for (var p in methods) proto[p] = methods[p];
	
	proto.constructor = constructor;
	proto.superclass = superclass;
	if(classname) proto.classname = classname;
	
	for(var i = 0 ; provides.length; i++) {
		var c = provides[i];
		for(var p in c.prototype) {
			if(typeof c.prototype[p] != 'function') continue;
			if(p == 'constructor' || p == 'superclass') continue;
			
			if(p in proto && typeof proto[p] == 'function' &&
				proto[p].length == c.prototype[p].length) continue;
			throw new Error('Class' + classname + 'does not provide method' + c.classname + '.' + p);
		}
	}
	
	constructor.prototype = proto;
	
	for( var p in statics ) constructor[p] = data.statics[p];

	return constructor;
};
